
from . import views
from django.urls import path, re_path




app_name = 'wiki'


urlpatterns = [

       path('', views.index, name="index"),#默认首页
       re_path(r'^detail/(?P<pk>\d+).html$', views.detail, name='detail'),

       # re_path(r'^archive/$', views.archive, name='archive'),
       re_path(r'^articles/$', views.archive, name='articles'),
       # re_path(r'^archive/(?P<year>[0-9]{4})/(?P<month>[0-9]{1,2})/$', views.archive, name='archive'),
       path('archive/<int:year>/<int:month>/', views.archive, name='archive'),  # http://127.0.0.1:8000/archive/2019/1/

       re_path(r'^tag/$', views.TagView.as_view(), name='tag'),
       re_path(r'^category/$', views.CategoryView.as_view(), name='category'),
       re_path(r'^archive/$', views.ArchiveView.as_view(), name='archive'),
       re_path(r'^wiki/search/$', views.search, name='search'),

       re_path(r'^tag/(?P<name>.*?)/$', views.tag, name='tag'),
       re_path(r'^category/(?P<pk>\d+)/$', views.category, name='category'),

]